home *** CD-ROM | disk | FTP | other *** search
- ItemClass = function()
- {
- this.init();
- };
- ItemClass.prototype = new MovieClip();
- ItemClass.prototype.init = function()
- {
- this.useHandCursor = false;
- this.txtFormat = new TextFormat();
- this.txtFormat.font = this.parent.txtFont;
- this.txtFormat.size = this.parent.txtSize;
- this.txtFormat.bold = this.txtIsBold;
- this.txtFormat.align = this.txtAlign;
- if(this.isTitle)
- {
- this.beginTxtX = 0;
- }
- else
- {
- this.beginTxtX = 10;
- }
- this.drawItem(0,0,this.menuWidth,this.parent.menuItemHeight,this.bgColor);
- this.drawText(this.beginTxtX,0,this.menuWidth,this.parent.menuItemHeight,this.txtColor,this.txtFormat,this.txtLabel);
- this.tabEnabled = false;
- };
- ItemClass.prototype.drawText = function(x, y, width, height, textCol, txtFormat, textLabel)
- {
- this.createTextField("textfield",1,x,y,width,height);
- this.textfield.autoSize = this.txtAlign;
- this.textField.html = true;
- if(!this.disabled)
- {
- this.textfield.textColor = textCol;
- }
- else
- {
- this.textfield.textColor = this.parent.disabledTextColor;
- }
- this.textfield.text = "" + textLabel;
- this.textfield.selectable = false;
- this.textfield.setTextFormat(txtFormat);
- this.textfield.embedFonts = true;
- this.textfield._y = Math.round((this.parent.menuItemHeight - this.textfield._height) / 2);
- };
- ItemClass.prototype.drawItem = function(x, y, width, height, fillCol)
- {
- this.clear();
- if(this.parent.sepLine || this.firstHoriz)
- {
- this.lineStyle(this.parent.sepLineSize,this.parent.sepLineColor,100);
- }
- this.beginFill(fillCol,100);
- if(fillCol == 1458837)
- {
- this.moveTo(x,y + 1);
- this.lineTo(x + width,y + 1);
- this.lineTo(x + width,y + height);
- this.lineTo(x,y + height);
- this.lineTo(x,y + 1);
- this.endFill();
- this.beginFill(1724600,100);
- this.moveTo(x,y);
- this.lineTo(x + width,y);
- this.lineTo(x + width,y + 1);
- this.lineTo(x,y + 1);
- this.lineTo(x,y);
- this.endFill();
- }
- else
- {
- this.moveTo(x,y);
- this.lineTo(x + width,y);
- this.lineTo(x + width,y + height);
- this.lineTo(x,y + height);
- this.lineTo(x,y);
- this.endFill();
- }
- this.createEmptyMovieClip("menuBorder",20000);
- if(fillCol == 1458837)
- {
- this.menuBorder.lineStyle(0,0,100);
- this.menuBorder.moveTo(x,y + 1);
- this.menuBorder.lineTo(x + width - 1,y + 1);
- this.menuBorder.lineTo(x + width - 1,y + height - 1);
- this.menuBorder.lineTo(x,y + height - 1);
- this.menuBorder.lineTo(x,y + 1);
- }
- if(!this.firstHoriz)
- {
- if(this.hasSubs)
- {
- this.attachMovie("ArrowSymbol","arrow",16000,{_x:Math.round(this.menuWidth) - 10,_y:Math.round((this.parent.menuItemHeight - 7) / 2)});
- }
- }
- if(this.radioGroup != undefined)
- {
- this.attachMovie("RadioButton","RadioButton",17000,{_x:10,_y:Math.round(this.parent.menuItemHeight / 2),_visible:this.active});
- }
- if(this.isCheckBox)
- {
- this.attachMovie("CheckBox","CheckBox",18000,{_x:10,_y:Math.round(this.parent.menuItemHeight / 2),_visible:this.checkBoxIsActive});
- }
- };
- ItemClass.prototype.setBackgroundColor = function(bgColor)
- {
- this.bgColor = bgColor;
- };
- ItemClass.prototype.setTextColor = function(txtColor)
- {
- this.txtColor = txtColor;
- };
- ItemClass.prototype.update = function()
- {
- this.drawItem(0,0,this.menuWidth,this.parent.menuItemHeight,this.bgColor);
- this.drawText(this.beginTxtX,0,this.menuWidth - 20,this.parent.menuItemHeight,this.txtColor,this.txtFormat,this.txtLabel);
- };
- Object.registerClass("ItemSymbol",ItemClass);
-